package com.extrace.misc.model;

import com.google.gson.annotations.Expose;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "TransNode")
public class TransNode implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = -3696487402698365947L;

    public TransNode() {
    }

    @Expose private String ID;
    @Expose private String nodeName;
    @Expose private Integer nodeType;
    @Expose private String regionCode;
    @Expose private String telCode;
    @Expose private Float x;
    @Expose private Float y;

    public void setID(String value) {
        this.ID = value;
    }

    public String getID() {
        return ID;
    }

    public String getORMID() {
        return getID();
    }

    public void setNodeName(String value) {
        this.nodeName = value;
    }

    public String getNodeName() {
        return nodeName;
    }

    public void setNodeType(Integer value) {
        this.nodeType = value;
    }

    public Integer getNodeType() {
        return nodeType;
    }

    public void setRegionCode(String value) {
        this.regionCode = value;
    }

    public String getRegionCode() {
        return regionCode;
    }

    public void setTelCode(String value) {
        this.telCode = value;
    }

    public String getTelCode() {
        return telCode;
    }

    public void setX(Float value) {
        this.x = value;
    }

    public Float getX() {
        return x;
    }

    public void setY(Float value) {
        this.y = value;
    }

    public Float getY() {
        return y;
    }

    public String toString() {
        return toString(false);
    }

    public String toString(boolean idOnly) {
        if (idOnly) {
            return String.valueOf(getID());
        }
        else {
            StringBuffer sb = new StringBuffer();
            sb.append("TransNode[ ");
            sb.append("ID=").append(getID()).append(" ");
            sb.append("NodeName=").append(getNodeName()).append(" ");
            sb.append("NodeType=").append(getNodeType()).append(" ");
            sb.append("RegionCode=").append(getRegionCode()).append(" ");
            sb.append("TelCode=").append(getTelCode()).append(" ");
            sb.append("X=").append(getX()).append(" ");
            sb.append("Y=").append(getY()).append(" ");
            sb.append("]");
            return sb.toString();
        }
    }

    private boolean _saved = false;

    public void onSave() {
        _saved=true;
    }


    public void onLoad() {
        _saved=true;
    }


    public boolean isSaved() {
        return _saved;
    }

}
